// 提现列表
<template>
    <div>
        <GoBack></GoBack>
        <div class="TxListBox">
              <p class="adselfBox">提现记录</p>
              <div class="txListCont" id='scrollDiv'>
                  <!-- 列表开始 -->
                  <div class="item flex flex-align-center" v-for='(item,index) in RadioList' :key='index' @click="jumpStatus(item.id)">
                      <div class="icon" v-if='item.status == 1'>
                          <img src="@/assets/img/user-center/tx-jywc.png">
                          <p>交易完成</p>
                      </div>
                       <div class="icon" v-else-if='item.status == 2'>
                          <img src="@/assets/img/user-center/tx-jysb.png">
                          <p>交易失败</p>
                      </div>
                       <div class="icon" v-else-if='item.status == 0'>
                          <img src="@/assets/img/user-center/tx-jxz.png">
                          <p>进行中</p>
                      </div>
                      <div class="time-text flex-1">
                          <p style="margin-top:0.08rem">{{item.card_number}}</p>
                          <p class="time">{{item.create_time}}</p>
                      </div>
                      <p>{{item.money}}元</p>
                  </div> <!-- 列表结束 -->
              </div>
        </div>
    </div>
</template>
<script>
import GoBack from '../goback'
export default {
    components: {
        GoBack
    },
    data () {
        return {
            isCode:'-1',
            RadioList:[],
            page:1,
            stup:true,
        }
    },
    mounted () {
        this.getObtainUserCashListById();
        this.scroll();
    },
    methods: {
        getObtainUserCashListById(){ //提现记录列表
            let uid = this.$store.state.userInfo.id;
            this.https('user/getObtainUserCashListById',{uid:uid,page:this.page})
            .then(data => {
                    if(data.data.length != ''){
                        for(let i in data.data){
                            this.RadioList.push(data.data[i]);
                        }
                        this.stup = true;
                    }else{
                        this.stup = false;
                    }
            })
        },
        scroll(){
            let _self = this;
            let scrollDiv = document.getElementById('scrollDiv');
            scrollDiv.addEventListener('scroll',function(){
                if(scrollDiv.scrollTop+scrollDiv.clientHeight == scrollDiv.scrollHeight && _self.stup){
                    _self.page ++;
                    _self.getObtainUserCashListById();
                }
            })
        },
        jumpStatus(id){
            this.$router.push({path: `/TxStatus/${id}`})
        }
    }
}
</script>
<style lang="less" scoped>
@import url(../../assets/css/usercenter/txlist.less);
</style>


